<?php

/**
 * Student filter form.
 *
 * @package    elearning
 * @subpackage filter
 * @author     Your name here
 */
class StudentFormFilter extends BaseStudentFormFilter
{
  public function configure()
  {
 	$widgetFrom = new sfWidgetFormDate(array('label' => 'De'));
	$widgetTo = new sfWidgetFormDate(array('label' => 'A'));
	$this->setWidget('created_at', new sfWidgetFormFilterDate(array('from_date' => $widgetFrom, 'to_date' => $widgetTo, 'with_empty' => false)));
	
	$this->widgetSchema['std_status'] = new sfWidgetFormChoice(array(
	            'choices' => TestPeer::getTestStatusChoices(),
				'expanded' => true,
	        ));
	
	$this->validatorSchema['std_status'] = new sfValidatorChoice(array(
	                'required'      => false,
	                'choices'       => array_keys(TestPeer::getTestStatusChoices()),
	        ));
	$this->widgetSchema->setNameFormat('student_filters[%s]');
  }
  
  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'country_id'       => 'ForeignKey',
      'language_id'      => 'ForeignKey',
      'std_account_name' => 'Text',
      'std_first_name'   => 'Text',
      'std_last_name'    => 'Text',
      'std_phone'        => 'Text',
      'std_email'        => 'Text',
      'std_avatar_image' => 'Text',
      'std_password'     => 'Text',
      'std_status'       => 'ForeignKey',
      'std_last_vistit'  => 'Date',
      'std_credit'       => 'Number',
      'created_at'       => 'Date',
      'updated_at'       => 'Date',
    );
  }
}
